Backport of functools.lru_cache from Python 3.3 as published at
ActiveState.
